var t = require("../../../@babel/runtime/helpers/defineProperty"), e = getApp();

Component({
    properties: {
        datas: {
            type: null
        },
        component_id: {
            type: null
        },
        page_id: {
            type: null
        },
        btnFlag: {
            type: null
        },
        bottomShowBol: {
            type: null
        },
        index: {
            type: null
        },
        bottomShowBolIndex: {
            type: null
        },
        store_id: {
            type: null
        }
    },
    data: {
        emptyImage: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/image.png",
        clientWidth: "375",
        U_tabcontrol: !0,
        isLast: !1,
        active: 0,
        show_text: "加载中...",
        show_page: !0
    },
    lifetimes: {
        attached: function() {},
        moved: function() {},
        detached: function() {}
    },
    attached: function() {},
    ready: function() {
        this.setData({
            clientWidth: wx.getSystemInfoSync().windowWidth
        }), this.data.bottomShowBolIndex == this.data.index && this.setData({
            isLast: !0
        });
    },
    pageLifetimes: {
        show: function() {},
        hide: function() {},
        resize: function() {}
    },
    methods: {
        getNetData: function(a) {
            var o = this;
            this.setData({
                show_page: !1,
                show_text: "加载中...",
                active: a
            });
            var i = {
                decorate_id: this.data.page_id,
                component_id: this.data.component_id,
                component_key: "U_tabcontrol",
                component_info: JSON.stringify({
                    list_key: a
                })
            }, n = e.getNetAddresss("home-page.get-decorate-page");
            this.properties.store_id && (i.store_id = this.properties.store_id, n = e.getNetAddresss("plugin.store-decorate.frotend.decorate-api.get-decorate-page")), 
            e._getNetWork({
                url: n,
                data: i,
                success: function(e) {
                    var i, n = e.data;
                    1 == n.result ? o.setData((t(i = {}, "datas.list[" + a + "].remote_data", n.data[0].remote_data), 
                    t(i, "show_page", !0), i)) : o.setData({
                        show_page: !1,
                        show_text: "后台没有设置数据或数据报错"
                    });
                },
                fail: function(t) {
                    console.log(t);
                }
            });
        },
        onClick: function(t) {
            var e = t.detail.index;
            this.getNetData(e);
        }
    }
});